<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>改变网页背景色</title>
    <style>
        body{
            background-color: #F3EFE0;
        }
        div{
            width: 400px;
            margin: 100px auto;
        }
        .bot{
            color: #918E84;
            font-family:Arial, Helvetica, sans-serif;
            font-size: 24px;
            position: relative;
            right: 200px;
            float: right;
        }
    </style>
</head>
<body>
    <div>
        <input type="button" value="设为红色" onclick="color('red')">
        <input type="button" value="设为黄色" onclick="color('yellow')">
        <input type="button" value="设为蓝色" onclick="color('blue')">
        <input type="button" value="设为自定义颜色" onclick="newColor()">
        <br><br><br>
        <input type="button" value="返回" onclick="location.href='../章节目录/第一章.html'" style="float: right;">
    </div>
    <div class="bot">
        <h3>Please appreciate((●'◡'●))......</h3>
    </div>
    <!-- <a href="default.html">返回</a> -->
    <script>
        function color(str){
            document.body.style.backgroundColor = str;
        }
        function newColor(){
            var str = prompt("请输入需要进行颜色切换的二进制码(如灰色#AAAAAA,粉红色#FFC0CB...)\n");
            document.body.style.backgroundColor = str;
        }
    </script>
</body>
</html> 